package com.example.shiro.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.shiro.model.common.Constant;
import com.example.shiro.user.entity.User;
import com.example.shiro.user.dao.UserDao;
import com.example.shiro.user.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author linyb
 * @since 2021-02-10
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserService {

    @Override
    public User getUserByAccount(String account) {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(Constant.ACCOUNT,account);
        User user = this.getOne(queryWrapper);
        return user;
    }
}
